// =======================================================================
// 
//       Filename:  pluginmanager.hpp
// 
//    Description:  
// 
//        Version:  1.0
//        Created:  09.05.2010 00:07:55
//       Revision:  none
//       Compiler:  g++
// 
//         Author:  Dominik 'domachine' Burgdörfer (-), dominik.burgdoerfer@googlemail.com
//        Company:  -
// 
// =======================================================================


#ifndef  PLUGINMANAGER_INC
#define  PLUGINMANAGER_INC
#include <boost/filesystem.hpp>
#include <boost/shared_ptr.hpp>
#include <vector>

namespace webplodder {
    // Forward declaration
    class Plugin;

    /**
     * @brief This class manages the plugins for the Processor.
     */
    class PluginManager {
        public:
            /**
             * @brief Constructs PluginManager instance.
             * @param pluginPath The path to search for plugins
             */
            PluginManager(const boost::filesystem::path& pluginPath);

            /**
             * @brief Scans the pluginPath for plugins.
             */
            void scanPlugins();

            /**
             * @brief Returns the plugin with a suitable name.
             * @throw std::runtime_error Is thrown if noc suitable
             *              plugin is found
             */
            boost::shared_ptr<Plugin> getPlugin(const std::string& name);

        private:
            boost::filesystem::path m_pluginPath;
            std::vector<boost::shared_ptr<Plugin> > m_plugins;
    };
}
#endif   // ----- #ifndef PLUGINMANAGER_INC  -----
